<?php

class MyController extends CController
{
	private $userinfo = null;

	public $css = array();
	public $js = array();
	public $meta_keywords;
	public $meta_description;
	public $meta_author;
	public function init()
	{
		parent::init();
		header('Content-Type: text/html; charset=utf-8');
	}

	public function _userinfo()
	{
		if(!Yii::app()->user->isGuest && !$this->userinfo)
		{
			$this->userinfo = Users::model()->findByPk(Yii::app()->user->getState('uid'));
		}
		return $this->userinfo;
	}
	
	public function json_return($status,$msg,$redirect='',$extra_data=array())
	{
		$return = array('_status'=>$status,'msg'=>$msg,'redirect'=>$redirect,'extra'=>$extra_data);
		$json = json_encode($return);
		echo $json;
		exit;
	}
}
function dollar_baidu()
{
	$return = Yii::app()->cache->get('dollarbaidu');
	if($return === false)
	{
		$return = 6.2305;
	}
	return $return;
}